pkgbase=dbus
pkgname=dbus-nox11
pkgver=1.10.18
pkgrel=1
pkgdesc="Freedesktop.org message bus system"
provides="dbus dbus-dev dbus-doc dbus-x11"
replaces="dbus dbus-dev dbus-doc dbus-x11"
url="http://www.freedesktop.org/Software/dbus"
pkggroups="messagebus"
arch="all"
license="GPL custom"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
triggers="$pkgname.trigger=/etc/dbus-1/system.d"
depends=
depends_dev="util-linux-dev"
makedepends="$depends_dev expat-dev libx11-dev autoconf automake libtool"
install="$pkgname.pre-install $pkgname.post-install"
source="http://dbus.freedesktop.org/releases/$pkgbase/$pkgbase-$pkgver.tar.gz
	fix-int64-print.patch
	$pkgbase.initd"
builddir=$srcdir/$pkgbase-$pkgver

prepare() {
	default_prepare
	autoreconf -vif
}

build() {
	cd "$srcdir"/$pkgbase-$pkgver
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--with-xml=expat \
		--with-dbus-user=messagebus \
		--with-system-pid-file=/var/run/dbus.pid \
		--disable-verbose-mode \
		--disable-static \
		--enable-inotify \
		--disable-dnotify \
		--disable-tests \
		--disable-asserts
	make
}

package() {
	cd "$srcdir"/$pkgbase-$pkgver
	make -j1 DESTDIR="$pkgdir" install
	install -Dm755 "$srcdir"/dbus.initd "$pkgdir"/etc/init.d/dbus
}

libs() {
	pkgdesc="Libraries for acces D-BUS"
	provides="dbus dbus-dev dbus-doc dbus-x11 dbus-libs"
	replaces="dbus dbus-dev dbus-doc dbus-x11 dbus-libs"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/lib*.so.* "$subpkgdir"/usr/lib/
}

sha512sums="726f97d0a2016f4f0625ba332e93e2d33bb16857cd35cb6c79da0f44fff297df948c3df62c31ffbec34713a7b85b3ff5b65f31517fe3511ddbd3bf18bd4748ed  dbus-1.10.18.tar.gz
5f07d8cb377ab80c927a77236c3f3437f08351161e594c62a1ad43f0324c2dba3cc98d50257ae27b9a4f5148571c5f26f35db8b40f13c72e92f267d5356c87f0  fix-int64-print.patch
5cdea3473afa62056b5b085b99105e420d672a4be853ea23f161c10dbc98862461f9ba67cd9ee112b54177876f94152a5db3a94f6f98793143c134d3f81d7ce0  dbus.initd"
